/**
 * &lt;p&gt;
 * copyright &amp;copy;  2015, all rights reserved.
 * @author Administrator
 * @version $Id$
 * @since 1.0
 * 
 */
package com.polymorphic;

/** <p>
 * @author LingMin 
 * @date 2017年9月29日<br>
 * @version 1.0<br>
 */
public class DynamicTest {

	 static abstract class Human {
		 
	        public void sayHello() {
	            System.out.println("你好");
	        }
	    }
	 
	    static class Man extends DynamicTest.Human {
	 
	        public void sayHello() {
	            System.out.println("您好，我是Y先生");
	        }
	    }
	 
	    static class Woman extends DynamicTest.Human {
	 
	        public void sayHello() {
	            System.out.println("您好，我是X美女");
	        }
	    }
	 
	    public static void main(String[] args) {
	        DynamicTest.Human manAsGuy = new DynamicTest.Man();// 注释1
	        DynamicTest.Human womanAsGuy = new DynamicTest.Woman();
	        manAsGuy.sayHello();
	        womanAsGuy.sayHello();
	    }
}
